﻿#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	/*printf("%d\n", 20);
	printf("%f\n", 3.14);
	printf("%c\n", 'a');

	printf("我是Peter\n");
	printf("我是%s\n", "Peter");

	printf("今年是%d年\n", 2024);

	printf("我是%s，性别%s，身高%f米，体重%d千克\n", "Mike", "男", 1.81, 60);*/

	/*int a;
	a = 10;
	printf("%d\n", a);

	int b = 20;
	printf("%d\n", b);

	int c = 11;
	int d = 12;
	printf("%d\n", c + d);
	int e = c + d;
	printf("%d\n", e);

	double m = 100.05;
	m = m + 3.14;
	printf("%f\n", m);*/

	/*int a = 10;
	printf("%d\n", a);
	a = 20;
	printf("%d\n", a);*/

	//变量不可重复定义
	/*int a = 30;
	printf("%d\n", a);*/

	//不建议使用这种写法，可读性不高
	/*int b = 5, c = 6, d = 7;
	printf("%d\n", b);
	printf("%d\n", c);
	printf("%d\n", d);*/

	//变量在使用前一定要赋值（初始化)
	/*int e;
	printf("%d\n", e);*/


	//二进制：代码中以0b开头
	/*int a = 0b10;
	printf("%d\n", a);*/

	//十进制：无任何前缀
	
	//八进制：代码中以0开头
	/*int b = 010;
	printf("%d\n", b);*/
	
	//十六进制：代码中以0x开头
	/*int c = 0x10;
	printf("%d\n", c);*/

	//short，短整型，Windows中占2个字节
	short a = 10;
	printf("%d\n", a);

	//int，整型，Windows中占4个字节
	int b = 100;
	printf("%d\n", b);

	//long，长整型，Windows中占4个字节
	long c = 1000L;
	printf("%ld\n", c);

	//long long，超长整型，Windows中占8个字节（C99才有）
	long long d = 10000LL;
	printf("%lld\n", d);

	//sizeof 测量数据类型占用多少个字节
	printf("%zu\n", sizeof(a));
	printf("%zu\n", sizeof(short));
	printf("%zu\n", sizeof(b));
	printf("%zu\n", sizeof(int));
	printf("%zu\n", sizeof(c));
	printf("%zu\n", sizeof(long));
	printf("%zu\n", sizeof(d));
	printf("%zu\n", sizeof(long long));




	return 0;
}